<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
						<input id="keepSampleId" name="keepSampleId" th:value="${keepSample.keepSampleId}"  type="hidden">
							<div class="form-group">	
								<label class="col-sm-3 control-label">品名：</label>
								<div class="col-sm-8">
									<select id="productId" name="productId" class="form-control" onchange="setSampleName()">

									</select>
								</div>
								<div class="col-sm-8">
									<input id="sampleName" name="sampleName" th:value="${keepSample.sampleName}" class="form-control" type="hidden">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">取样时间：</label>
								<div class="col-sm-8">
									<input id="sampleDate" name="sampleDate"  class="form-control" type="text">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">批次：</label>
								<div class="col-sm-8">
									<input id="code" name="code" th:value="${keepSample.code}" class="form-control" type="text">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">留样温度：</label>
								<div class="col-sm-8">
									<!--<input id="sampleTemperature" name="sampleTemperature" th:value="${keepSample.sampleTemperature}" class="form-control" type="text">-->
									<select id="sampleTemperature" name="sampleTemperature" class="form-control">
										<option value="0">恒温</option>
										<option value="1">常温</option>
									</select>
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">数量：</label>
								<div class="col-sm-8">
									<input id="number" name="number" th:value="${keepSample.number}" class="form-control" type="text">
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-3 control-label">备注：</label>
								<div class="col-sm-8">
									<input id="remake" name="remake" th:value="${keepSample.remake}" class="form-control" type="text">
								</div>
							</div>
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">取样人 :用户id：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="sampleMan" name="sampleMan" th:value="${keepSample.sampleMan}" class="form-control" type="text">-->
								<!--</div>-->
							<!--</div>-->
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">留样记录人 :用户id：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="keepSampleMan" name="keepSampleMan" th:value="${keepSample.keepSampleMan}" class="form-control" type="text">-->
								<!--</div>-->
							<!--</div>-->
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="state" name="state" th:value="${keepSample.state}" class="form-control" type="text">-->
								<!--</div>-->
							<!--</div>-->
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="createBy" name="createBy" th:value="${keepSample.createBy}" class="form-control" type="text">-->
								<!--</div>-->
							<!--</div>-->
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="createDate" name="createDate" th:value="${keepSample.createDate}" class="form-control" type="text">-->
								<!--</div>-->
							<!--</div>-->
																					<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
	</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" th:inline="javascript">
		function setSampleDate() {
			var sampleDate = [[${keepSample.sampleDate}]];
			console.log(sampleDate)
			if (sampleDate != null){
			    sampleDate = sampleDate.substring(0,10);
			}
			$("#sampleDate").val(sampleDate);
        }

        function getSampleDate() {
            var sampleDate = [[${keepSample.sampleDate}]]
            var newDate = new Date(sampleDate);
            var result = DateFormat.format(newDate, 'yyyy-MM-dd hh:mm:ss')
            laydate.render({
                elem: '#sampleDate',
                type: 'datetime',
//                format: 'yyyy-MM-dd HH:mm:ss',
                value: result
            });
        }

        function setSampleTemperature() {
            var sampleTemperature = [[${keepSample.sampleTemperature}]];
            $("#sampleTemperature").empty()
            var html = '';
            if (sampleTemperature == 0){
                html += "<option value='0' selected='selected'>恒温</option>"
                html += "<option value='1'>常温</option>"
			}else{
                html += "<option value='0'>恒温</option>"
                html += "<option value='1' selected='selected'>常温</option>"
			}
			$("#sampleTemperature").append(html);
        }

        function getProductId() {
            var productId = [[${keepSample.productId}]]
			return productId;
        }
        function setSampleName() {
            var productName = $("#productId").find("option:selected").text()
            $("#sampleName").val(productName);
            console.log($("#sampleName").val())
        }
	</script>
	<script type="text/javascript" th:src="@{/js/appjs/check/keepSample/edit.js}" src="/js/appjs/check/keepSample/edit.js">
	</script>

</body>
</html>
